home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / os20 / wb / toolmanager2_0.lha / ToolManager / Scripts / pack.sh < prev    next >
Text File  |  1992-09-26  |  1KB  |  58 lines

  1. #
  2. #   pack.sh  -  add to a new archive
  3. #
  4. set file $_passed
  5. # Uncomment the following line if the default destination directory should
  6. # be where the archive came from:
  7. #
  8.  
  9. alias center "%a echo @center( $a 77 )
  10.  
  11. if $file <> ""
  12.  class.sh toolmanager
  13.  set toadd ""
  14.  set arc   ""
  15.  set lharc lharc
  16.  
  17.  foreach i ( $file ) {
  18.   if @getclass( $i ) = $lharc
  19.    set arc $i
  20.    set lharc xxx
  21.   else
  22.    set toadd $toadd $i
  23.   endif
  24.  }
  25.  
  26.  if -n $arc
  27.   set destdir @pathname( @first( $toadd ) )
  28.   if @words( $toadd ) = 1
  29.    set default @basename( $toadd )
  30.    set default $default.LZH
  31.   endif
  32.   tackon pattern $destdir "*.lzh"
  33.   set arc @filereq( "Archive to add to:" $pattern $default )
  34.  endif
  35.  
  36.  if $arc
  37.   set   destdir @pathname( $arc )
  38.   cd   $destdir
  39.   lharc a $arc $toadd 
  40.  endif
  41.  
  42. else
  43.  center
  44.  center "* * *  PACK  * * *"
  45.  center
  46.  center "If you select a set of icons with an LHarc archive among them, the
  47.  center "files will be added to the archive. If no archive is among them,
  48.  center "you can select an archive name from a file requester.
  49.  center
  50.  center "You have to select 'Update' from the workbench's 'Window' menu to
  51.  center "see the new file if the destination drawer was already open.
  52.  center
  53.  center "To modify the program used for archiving, read the
  54.  center "chapter 'object oriented features' in your csh.doc.
  55.  center
  56.  center "Click close button when done
  57. endif
  58.